<!DOCTYPE html>
<html>
<head>
    <title>模具类型位置关联</title>
    #parse("sys/header.html")
    <style>
        .sugon_upload_btn {
            display: -webkit-inline-box;
            display: inline-block;
        }
    </style>
</head>
<body>
<div id="rrapp" v-cloak>
    <div v-show="showList">
        <Row :gutter="16" style="margin: 8px 0px 0px 1px">
            <div class="search-group">
                <i-col span="3">
                    <i-input v-model="q.name" @on-enter="query" placeholder="备件名称"></i-input>
                </i-col>
                <i-col span="3">
                    <i-input v-model="q.positionNo" @on-enter="query" placeholder="位置号"></i-input>
                </i-col>
                <i-col span="3">
                    <i-select v-model="q.modType" placeholder="类型">
                        <i-option v-for="moldPositionType in moldPositionTypes" :value="moldPositionType"
                                  :key="moldPositionType">{{moldPositionType}}
                        </i-option>
                    </i-select>
                </i-col>
                <i-button @click="query">查询</i-button>
                <i-button @click="reloadSearch">重置</i-button>
            </div>
        </Row>
        <Row :gutter="16" style="margin: 3px 0px 0px 0px;">
            <div class="buttons-group">
                <i-button type="info" @click="exportData"><i class="fa fa-hand-o-up"></i>&nbsp;导出</i-button>
                <Upload ref="uploadFile" action="../moldTypePosition/import"
                        :format="['xlsx','xls']" :before-upload="handleBeforeUpload"
                        :on-success="handleSuccess" :on-error="handleError"
                        :on-format-error="handleFormatError" class="sugon_upload_btn">
                    <i-button type="error"><i class="fa fa-hand-o-down"></i>&nbsp;导入</i-button>
                </Upload>
                #if($shiro.hasPermission("modulpositioncorrelation:save"))
                <i-button type="primary" @click="add"><i class="fa fa-plus"></i>&nbsp;新增</i-button>
                #end
                #if($shiro.hasPermission("modulpositioncorrelation:update"))
                <i-button type="warning" @click="update"><i class="fa fa-pencil-square-o"></i>&nbsp;修改</i-button>
                #end
                #if($shiro.hasPermission("modulpositioncorrelation:delete"))
                <i-button type="error" @click="del"><i class="fa fa-trash-o"></i>&nbsp;删除</i-button>
                #end
            </div>
        </Row>
        <table id="jqGrid"></table>
    </div>

    <Card v-show="!showList">
        <p slot="title">{{title}}</p>
        <i-form ref="formValidate" :model="modulPositionCorrelation" :rules="ruleValidate" :label-width="100">
            <Row>
                <i-col span="11">
                    <Form-item label="备件名称" prop="positionName">
                        <i-input v-model="modulPositionCorrelation.positionName" placeholder="备件名称"></i-input>
                    </Form-item>
                </i-col>
                <i-col span="11"  offset="1">
                    <Form-item label="位置号" prop="positionNo">
                        <i-input v-model="modulPositionCorrelation.positionNo" placeholder="位置号"></i-input>
                    </Form-item>
                </i-col>
            </Row>
            <Row>
                <i-col span="11">
                    <Form-item label="规格" prop="spec">
                        <i-input v-model="modulPositionCorrelation.spec" placeholder="规格"></i-input>
                    </Form-item>
                </i-col>
                <i-col span="11" offset="1">
                    <Form-item label="类型" prop="modType">
                        <i-select v-model="modulPositionCorrelation.modType" placeholder="类型">
                            <i-option v-for="moldPositionType in moldPositionTypes" :value="moldPositionType"
                                      :key="moldPositionType">{{moldPositionType}}
                            </i-option>
                        </i-select>
                    </Form-item>
                </i-col>
            </Row>
            <Row>
                <i-col span="11">
                    <Form-item label="寿命标准" prop="lifeStandard">
                        <input-number v-model="modulPositionCorrelation.lifeStandard" :min="1" placeholder="寿命标准" style="width: 100%"></input-number>
                    </Form-item>
                </i-col>
                <i-col span="11" offset="1">
                    <Form-item label="适用型芯规则" prop="barCodeRange">
                        <i-input v-model="modulPositionCorrelation.barCodeRange" placeholder="多个型芯条码间用|隔开，如：1023|0802"></i-input>
                    </Form-item>
                </i-col>
            </Row>
            <Row>
                <i-col span="11">
                    <Form-item label="特殊处理" prop="positionRemark">
                        <i-input type="textarea" v-model="modulPositionCorrelation.positionRemark" placeholder="特殊处理"></i-input>
                    </Form-item>
                </i-col>
            </Row>
            <Form-item>
                <i-button type="primary" @click="handleSubmit('formValidate')">提交</i-button>
                <i-button type="warning" @click="reload" style="margin-left: 8px">
                    返回
                </i-button>
                <i-button type="info" @click="handleReset('formValidate')" style="margin-left: 8px">重置</i-button>
            </Form-item>
        </i-form>
    </Card>
</div>

<script src="${rc.contextPath}/js/module/moldTypePosition.js?_${date.systemTime}"></script>
</body>
</html>
